For demonstration we’ll load the crop_and_soil_tbl data from the mgrtibbles package (hyperlink includes install instructions).
#Load packagelibrary("mgrtibbles")#mammal_sleep_tbl tibble for demonstrationmgrtibbles::crop_and_soil_tbl |>#View first four columns with select dplyr::select(1:4)
Split the column Temperature_celsius_kelvin into 2 columns by the delimiter ““. This will produce a Temp_celsius column and a -Temp_kelvin__ column.
crop_and_soil_tbl |>#Select first four columns dplyr::select(1:4) |>#Separate wider tidyr::separate_wider_delim(Temperature_celsius_kelvin, delim="_",names =c("Temp_celsius", "Temp_kelvin")) |>#Mutate across the two columns to convert them to numeric columns dplyr::mutate(dplyr::across(Temp_celsius:Temp_kelvin, as.numeric))